package com.guoyw.dubbo.bootclient;

import com.guoyw.dubbo.member.entity.User;
import com.guoyw.dubbo.member.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@EnableDubbo
@SpringBootApplication
public class BootClientApplication{

  @Reference
  UserService userService;
  
  public static void main(String[] args){
    SpringApplication.run(BootClientApplication.class, args);
  }
  
  
  @Bean
  public ApplicationRunner getBean() {

    return args -> {
      System.out.println(userService.getUser(1));
    };
  }

}
